import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { InferenceLogVO, InferenceLogForm, InferenceLogQuery } from '@/api/bclt/inferenceLog/types';

/**
 * 查询推理日志列表
 * @param query
 * @returns {*}
 */

export const listInferenceLog = (query?: InferenceLogQuery): AxiosPromise<InferenceLogVO[]> => {
  return request({
    url: '/bclt/inferenceLog/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询推理日志详细
 * @param id
 */
export const getInferenceLog = (id: string | number): AxiosPromise<InferenceLogVO> => {
  return request({
    url: '/bclt/inferenceLog/' + id,
    method: 'get'
  });
};

/**
 * 新增推理日志
 * @param data
 */
export const addInferenceLog = (data: InferenceLogForm) => {
  return request({
    url: '/bclt/inferenceLog',
    method: 'post',
    data: data
  });
};

/**
 * 修改推理日志
 * @param data
 */
export const updateInferenceLog = (data: InferenceLogForm) => {
  return request({
    url: '/bclt/inferenceLog',
    method: 'put',
    data: data
  });
};

/**
 * 删除推理日志
 * @param id
 */
export const delInferenceLog = (id: string | number | Array<string | number>) => {
  return request({
    url: '/bclt/inferenceLog/' + id,
    method: 'delete'
  });
};
